<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>JMeter压测RabbitMQ-02：AMQP插件使用 | Xuan的博客</title><meta name="author" content="Xuan"><meta name="copyright" content="Xuan"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="JMeter压测RabbitMQ-02：AMQP插件使用安装成功后，JMeter在线程组下可以添加两个取样器，分别是：  AMQP Consumer AMQP Publisher   AMQP PublisherAMQP Publisher分成两个部分组成，第一部分为消息的基本信息，第二部分为具体消息内容 消息基本信息   采样器的名称和备注，用来进行线程组采样器的管理，默认为AMQP Publi">
<meta property="og:type" content="article">
<meta property="og:title" content="JMeter压测RabbitMQ-02：AMQP插件使用">
<meta property="og:url" content="http://leesmile.gitee.io/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-02%EF%BC%9AAMQP%E6%8F%92%E4%BB%B6%E5%8F%82%E6%95%B0%E4%BB%8B%E7%BB%8D%E5%8F%8A%E4%BD%BF%E7%94%A8/index.html">
<meta property="og:site_name" content="Xuan的博客">
<meta property="og:description" content="JMeter压测RabbitMQ-02：AMQP插件使用安装成功后，JMeter在线程组下可以添加两个取样器，分别是：  AMQP Consumer AMQP Publisher   AMQP PublisherAMQP Publisher分成两个部分组成，第一部分为消息的基本信息，第二部分为具体消息内容 消息基本信息   采样器的名称和备注，用来进行线程组采样器的管理，默认为AMQP Publi">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg">
<meta property="article:published_time" content="2024-02-27T13:55:46.000Z">
<meta property="article:modified_time" content="2024-02-27T13:55:46.000Z">
<meta property="article:author" content="Xuan">
<meta property="article:tag" content="rabbitMQ">
<meta property="article:tag" content="性能测试">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg"><link rel="shortcut icon" href="/smile/img/favicon.png"><link rel="canonical" href="http://leesmile.gitee.io/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-02%EF%BC%9AAMQP%E6%8F%92%E4%BB%B6%E5%8F%82%E6%95%B0%E4%BB%8B%E7%BB%8D%E5%8F%8A%E4%BD%BF%E7%94%A8/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/smile/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/smile/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'JMeter压测RabbitMQ-02：AMQP插件使用',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-02-27 21:55:46'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/font.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="/css/custom.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="/css/whiteLine.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="/css/progress_bar.css" media="defer" onload="this.media='all'"><link rel="stylesheet" href="/css/cat.css"><link rel="stylesheet" href="/css/readPercent.css"><link rel="stylesheet" href="https://cdn1.tianli0.top/npm/element-ui@2.15.6/packages/theme-chalk/lib/index.css"><div id="myscoll"></div><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-double-row-display@1.00/cardlistpost.min.css"/>
<style>#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags:before {content:"\A";
  white-space: pre;}#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags > .article-meta__separator{display:none}</style>
<link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-footer-beautify@1.0.0/lib/runtime.css" media="print" onload="this.media='all'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://leesmile.gitee.io/smile/img/avatarImg.bmp" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/smile/archives/"><div class="headline">文章</div><div class="length-num">142</div></a><a href="/smile/tags/"><div class="headline">标签</div><div class="length-num">36</div></a><a href="/smile/categories/"><div class="headline">分类</div><div class="length-num">32</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/smile/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/smile/archives/"><i class="fa-fw fas fa-archive"></i><span> 文章</span></a></div><div class="menus_item"><a class="site-page" href="/smile/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/smile/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg')"><nav id="nav"><span id="blog-info"><a href="/smile/" title="Xuan的博客"><span class="site-name">Xuan的博客</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/smile/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/smile/archives/"><i class="fa-fw fas fa-archive"></i><span> 文章</span></a></div><div class="menus_item"><a class="site-page" href="/smile/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/smile/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div></div><div id="nav-right"><a class="meihua faa-parent animated-hover" onclick="toggleWinbox()" title="美化设置-自定义你的风格" id="meihua-button"><svg class="faa-tada icon" style="height:26px;width:26px;fill:currentColor;position:relative;top:8px" aria-hidden="true"><use xlink:href="#icon-tupian1"></use></svg></a><a class="sun_moon faa-parent animated-hover" onclick="switchNightMode()" title="浅色和深色模式转换" id="nightmode-button"><svg class="faa-tada" style="height:25px;width:25px;fill:currentColor;position:relative;top:7px" viewBox="0 0 1024 1024"><use id="modeicon" xlink:href="#icon-moon"></use></svg></a></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">JMeter压测RabbitMQ-02：AMQP插件使用</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-02-27T13:55:46.000Z" title="发表于 2024-02-27 21:55:46">2024-02-27</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-02-27T13:55:46.000Z" title="更新于 2024-02-27 21:55:46">2024-02-27</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/smile/categories/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/">性能测试</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/smile/categories/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/smile/categories/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/%E4%B8%AD%E9%97%B4%E4%BB%B6/rabbitMQ/">rabbitMQ</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="JMeter压测RabbitMQ-02：AMQP插件使用"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div><section class="main-hero-waves-area waves-area"><svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"></path></defs><g class="parallax"><use href="#gentle-wave" x="48" y="0"></use><use href="#gentle-wave" x="48" y="3"></use><use href="#gentle-wave" x="48" y="5"></use><use href="#gentle-wave" x="48" y="7"></use></g></svg></section><div id="post-top-cover"><img class="nolazyload" id="post-top-bg" src="background-image: url('https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg')"></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="JMeter压测RabbitMQ-02：AMQP插件使用"><a href="#JMeter压测RabbitMQ-02：AMQP插件使用" class="headerlink" title="JMeter压测RabbitMQ-02：AMQP插件使用"></a>JMeter压测RabbitMQ-02：AMQP插件使用</h1><p>安装成功后，JMeter在线程组下可以添加两个取样器，分别是：</p>
<ol>
<li>AMQP Consumer</li>
<li>AMQP Publisher</li>
</ol>
<p><img src="https://gitee.com/leesmile/image-host/raw/master/images/202311071351825.png" alt="image-20231107135158148"></p>
<h3 id="AMQP-Publisher"><a href="#AMQP-Publisher" class="headerlink" title="AMQP Publisher"></a>AMQP Publisher</h3><p>AMQP Publisher分成两个部分组成，第一部分为消息的基本信息，第二部分为具体消息内容</p>
<p><strong>消息基本信息</strong></p>
<p><img src="https://gitee.com/leesmile/image-host/raw/master/images/202311071403688.png" alt="image-20231107140336990"></p>
<ol>
<li><p>采样器的名称和备注，用来进行线程组采样器的管理，默认为AMQP Publisher。</p>
</li>
<li><p>Exchange交换机信息，如果发送的消息是以交换机信息进行传递，则需要配置，如果不需要则将Exchange属性置空即可。</p>
<ol>
<li><p>Exchange：交换机名称，默认为jmeterExchange。</p>
</li>
<li><p>Exchange Type：交换机类型，规定了消息的路由策略。</p>
<blockquote>
<p>根据实际的消息交换机类型进行配置，可选为direct,topic,headers,fanout。</p>
</blockquote>
</li>
<li><p>Durable？：交换机的持久化属性。</p>
</li>
<li><p>Auto Delete？：交换机的自动删除属性。</p>
</li>
<li><p>Redeclare？：该交换机是否可以重新声明。</p>
<blockquote>
<p>问题：交换机Durable或者Auto Delete属性与已经存在交换机不一致时会出现报错。</p>
<p>Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method&lt;channel.close&gt;(reply-code&#x3D;406, reply-text&#x3D;PRECONDITION_FAILED - inequivalent arg ‘durable’ for queue ‘ack_queue’ in vhost ‘&#x2F;‘: received ‘true’ but current is ‘false’, class-id&#x3D;50, method-id&#x3D;10)</p>
<p>解决方法：若勾选该选项，会删除原本的队列，重新声明队列</p>
</blockquote>
</li>
</ol>
</li>
<li><p>Queue队列信息，如果需要发送的MQ消息是以队列的方式进行消息传递，需要配置，如果不需要则配置“Queue”属性为空即可</p>
<ol>
<li><p>Queue：队列名称，默认为jmeterQueue。</p>
</li>
<li><p>Routing Key：队列的路由关键字，通过路由关键字的设定</p>
<blockquote>
<p>用于完成多个消息统一处理的需求，对于队列的方式，需要与队列名称一致。</p>
</blockquote>
</li>
<li><p>Exclusive?：队列的排他性属性。</p>
<blockquote>
<p>如果想创建一个只有自己可见的队列，即不允许其它用户访问，可以将一个Queue声明成为排他性的（Exclusive Queue）。</p>
</blockquote>
</li>
<li><p>Message TTL：Time-To-Live，消息过期时间，单位为毫秒。</p>
</li>
<li><p>Expires：队列的超期时间，单位为毫秒。</p>
<blockquote>
<p>该值必须为正数(与消息 TTL 不同，该值不可以为 0)，所以如果该参数设置为 1000 ，则表示该队列如果在 1 秒钟之内未被使用则会被删除。</p>
</blockquote>
</li>
</ol>
</li>
<li><p>RabbitMQ服务信息</p>
<ol>
<li><p>Virtual HOST：使用的RabbitMQ服务虚拟主机信息。</p>
<blockquote>
<p>通过虚拟主机可以在服务器上划分多个虚拟空间，起到消息隔离的作用，默认为根目录“&#x2F;”。</p>
</blockquote>
</li>
<li><p>Host：RabbitMQ服务所在主机IP或名称。</p>
<blockquote>
<p>使用名称时需要保证DNS正确性。</p>
</blockquote>
</li>
<li><p>Port：RabbitMQ服务所在端口，默认为5672。</p>
</li>
<li><p>Username：使用RabbitMQ服务的用户名。</p>
</li>
<li><p>Password：使用RabbitMQ服务的密码。</p>
</li>
<li><p>Timeout：连接RabbitMQ服务的超时时间，单位为毫秒。</p>
</li>
</ol>
</li>
</ol>
<p><strong>具体消息内容</strong></p>
<p><img src="https://gitee.com/leesmile/image-host/raw/master/images/202311071418704.png" alt="image-20231107141820539"></p>
<ol>
<li><p>发送消息数目：Number ofsamples to Aggregate表示AMQP采样器工作一次发送几条消息。</p>
</li>
<li><p>消息属性：</p>
<ol>
<li><p>Persistent?：消息的持久化属性。</p>
<blockquote>
<p>设置了持久化的消息，即使当时Consumer没有在监听，等Consumer启动后也能够收到该消息。反之，如果当时Consumer没有监听，则无法获取消息。</p>
</blockquote>
</li>
<li><p>Use Transactions？:是否将发送消息通道设置为事务模式。</p>
<blockquote>
<p>事务能够解决Publisher与消息服务之间消息确认的问题，只有消息成功被服务接受，事务提交才能成功，否则我们便可以在捕获异常进行事务回滚操作同时进行消息重发，但是使用事务机制的话会降低RabbitMQ的性能。</p>
</blockquote>
</li>
<li><p>Routing Key：消息的路由关键字。</p>
<blockquote>
<p>队列方式需要与队列名称一致，交换机方式根据实际需求设定。</p>
</blockquote>
</li>
<li><p>Message Type：消息类型属性。</p>
<blockquote>
<p> 可以自定义消息的类型，如String,Object等。</p>
</blockquote>
</li>
<li><p>Reply-To Queue：用于指定回复的队列的名称。</p>
<blockquote>
<p>该属性是业务流程的需要，不会自动创建指定的回复队列。</p>
</blockquote>
</li>
<li><p>Correlation Id：消息的关联ID。</p>
<blockquote>
<p>当存在多个计算节点时，通过该属性是的每个线程确定收到的消息与该线程对应。</p>
</blockquote>
</li>
<li><p>ContentType：消息扩展类型。</p>
<blockquote>
<p>与HTTP中的相同字段意义一致，可以是text&#x2F;plain，JSON等。</p>
</blockquote>
</li>
<li><p>Message Id：消息的ID。</p>
<blockquote>
<p>通过设定消息ID，完成业务上的某些需求。</p>
</blockquote>
</li>
</ol>
</li>
<li><p>消息头信息：Key-Value的形式传递</p>
</li>
<li><p>消息体：实际发送的消息内容</p>
</li>
</ol>
<h3 id="AMQP-Consumer"><a href="#AMQP-Consumer" class="headerlink" title="AMQP Consumer"></a>AMQP Consumer</h3><p>AMQP Consumer也是分成两个部分组成，第一部分为消息的基本信息，第二部分为具体接收消息设置</p>
<p><strong>消息基本信息</strong></p>
<p><img src="https://gitee.com/leesmile/image-host/raw/master/images/202311071424768.png" alt="image-20231107142404077"></p>
<p>基本与AMQP Publisher相似，根据具体情况配置即可</p>
<p><strong>具体接收消息设置</strong></p>
<ol>
<li><p>接受设置</p>
<ol>
<li><p>Number of samples to Aggregate：采样器工作一次消费几条消息。</p>
</li>
<li><p>Reccive Timeout：接收超时时间。</p>
<blockquote>
<p>即等待设置时间没有收到消息则退出，单位毫秒。</p>
</blockquote>
</li>
<li><p>PrefetchCount：预先获取的消息条数。</p>
<blockquote>
<p>Prefetch Count允许为每个Consumer指定最大unacked messages数目。简单来说就是用来指定一个Consumer一次可以从消息中心中获取多少条message并缓存。一旦缓冲区满了，会停止投递新的message给该Consumer，直到它发出ack。</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 代码中的参数设置</span></span><br><span class="line">channel.basicQos(prefetchCount);</span><br></pre></td></tr></table></figure></li>
</ol>
</li>
<li><p>队列操作</p>
<ol>
<li><p>Purge Queue：清除队列</p>
<blockquote>
<p>消费消息后将队列清空</p>
</blockquote>
</li>
<li><p>Auto ACK：自动应答属性</p>
<blockquote>
<p>在订阅消息的时候可以指定应答模式，当自动应答等于true的时候，表示当消费者一收到消息就表示消费者收到了消息，消费者收到了消息就会立即从队列中删除</p>
</blockquote>
</li>
<li><p>Read Response：读取消息内容</p>
</li>
</ol>
</li>
</ol>
<p>3、UseTransactions？：与AMQP Publisher含义一致。</p>
<blockquote>
<p>参考文章：<a target="_blank" rel="noopener" href="https://www.163.com/dy/article/E9OCNL9105317EFI.html">JMeter RabbitMQ采样器AMQP详解与实战</a></p>
</blockquote>
</article><div class="post-copyright"><div class="post-copyright__title"><span class="post-copyright-info"><h>JMeter压测RabbitMQ-02：AMQP插件使用</h></span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="http://leesmile.gitee.io/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-02%EF%BC%9AAMQP%E6%8F%92%E4%BB%B6%E5%8F%82%E6%95%B0%E4%BB%8B%E7%BB%8D%E5%8F%8A%E4%BD%BF%E7%94%A8/">http://leesmile.gitee.io/smile/2024/02/27/性能测试/JMeter压测RabbitMQ-02：AMQP插件参数介绍及使用/</a></span></div><div class="post-copyright-m"><div class="post-copyright-m-info"><div class="post-copyright-a"><h>作者</h><div class="post-copyright-cc-info"><h>Xuan</h></div></div><div class="post-copyright-c"><h>发布于</h><div class="post-copyright-cc-info"><h>2024-02-27</h></div></div><div class="post-copyright-u"><h>更新于</h><div class="post-copyright-cc-info"><h>2024-02-27</h></div></div><div class="post-copyright-c"><h>许可协议</h><div class="post-copyright-cc-info"><a class="icon" rel="noopener" target="_blank" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a><a rel="noopener" target="_blank" title="CC BY-NC-SA 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a></div></div></div></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/smile/tags/rabbitMQ/">rabbitMQ</a><a class="post-meta__tags" href="/smile/tags/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/">性能测试</a></div><div class="post_share"><div class="social-share" data-image="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-01%EF%BC%9A%E6%8F%92%E4%BB%B6%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/" title="JMeter压测RabbitMQ-01：插件安装配置"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg" onerror="onerror=null;src='/smile/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">JMeter压测RabbitMQ-01：插件安装配置</div></div></a></div><div class="next-post pull-right"><a href="/smile/2024/02/15/Java/Java%E7%90%86%E8%AE%BA/%E9%9B%86%E5%90%88%E6%A1%86%E6%9E%B6/HashMap%E7%9A%84%E6%96%B0%E5%A2%9E%E6%B5%81%E7%A8%8B/" title=""><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202310201611606.jpg" onerror="onerror=null;src='/smile/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info"></div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-03%EF%BC%9A%E4%BF%AE%E6%94%B9AMQP%E6%8F%92%E4%BB%B6%E6%94%AF%E6%8C%81quorum%E9%98%9F%E5%88%97/" title="JMeter压测RabbitMQ-03：修改AMQP源码支持quorum队列"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-02-27</div><div class="title">JMeter压测RabbitMQ-03：修改AMQP源码支持quorum队列</div></div></a></div><div><a href="/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-01%EF%BC%9A%E6%8F%92%E4%BB%B6%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/" title="JMeter压测RabbitMQ-01：插件安装配置"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-02-27</div><div class="title">JMeter压测RabbitMQ-01：插件安装配置</div></div></a></div><div><a href="/smile/2024/02/27/%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95/JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-04%EF%BC%9A%E4%BD%BF%E7%94%A8JMeter%E8%B0%83%E7%94%A8SpringBoot%E5%8F%91%E9%80%81MQ/" title="JMeter压测RabbitMQ-03：修改AMQP源码支持quorum队列"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311071447144.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-02-27</div><div class="title">JMeter压测RabbitMQ-03：修改AMQP源码支持quorum队列</div></div></a></div><div><a href="/smile/2023/11/01/%E4%B8%AD%E9%97%B4%E4%BB%B6/RabbitMq/RabbitMQ-02%EF%BC%9ARabbitMQ%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/" title="RabbitMQ-02：RabbitMQ环境搭建"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311022138908.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-11-01</div><div class="title">RabbitMQ-02：RabbitMQ环境搭建</div></div></a></div><div><a href="/smile/2023/11/01/%E4%B8%AD%E9%97%B4%E4%BB%B6/RabbitMq/RabbitMQ-01%EF%BC%9AMQ%E3%80%81RabbitMQ%E7%AE%80%E4%BB%8B/" title="RabbitMQ-01：MQ、RabbitMQ简介"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311022138908.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-11-01</div><div class="title">RabbitMQ-01：MQ、RabbitMQ简介</div></div></a></div><div><a href="/smile/2023/11/02/%E4%B8%AD%E9%97%B4%E4%BB%B6/RabbitMq/RabbitMQ-06%EF%BC%9A%E6%B6%88%E6%81%AF%E6%8C%81%E4%B9%85%E5%8C%96%E4%B8%8E%E4%B8%8D%E5%85%AC%E5%B9%B3%E5%88%86%E5%8F%91/" title="RabbitMQ-06：消息持久化与不公平分发：消息应答"><img class="cover" src="https://gitee.com/leesmile/image-host/raw/master/images/202311022138908.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-11-02</div><div class="title">RabbitMQ-06：消息持久化与不公平分发：消息应答</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="author_top is-center"><div class="avatar-img"><img src="https://leesmile.gitee.io/smile/img/avatarImg.bmp" onerror="this.onerror=null;this.src='/smile/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Xuan</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/smile/archives/"><div class="headline">文章</div><div class="length-num">142</div></a><a href="/smile/tags/"><div class="headline">标签</div><div class="length-num">36</div></a><a href="/smile/categories/"><div class="headline">分类</div><div class="length-num">32</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#JMeter%E5%8E%8B%E6%B5%8BRabbitMQ-02%EF%BC%9AAMQP%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8"><span class="toc-number">1.</span> <span class="toc-text">JMeter压测RabbitMQ-02：AMQP插件使用</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#AMQP-Publisher"><span class="toc-number">1.0.1.</span> <span class="toc-text">AMQP Publisher</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#AMQP-Consumer"><span class="toc-number">1.0.2.</span> <span class="toc-text">AMQP Consumer</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/smile/2024/04/08/%E4%B8%8D%E5%90%8C%E8%A7%92%E5%BA%A6%E5%87%BA%E5%8F%91%E5%8E%BB%E9%9C%80%E6%B1%82%E6%B2%9F%E9%80%9A%E9%97%AE%E9%A2%98/" title="不同角度出发去需求沟通问题"><img src="https://gitee.com/leesmile/image-host/raw/master/images/202310271509358.jpg" onerror="this.onerror=null;this.src='/smile/img/404.jpg'" alt="不同角度出发去需求沟通问题"/></a><div class="content"><a class="title" href="/smile/2024/04/08/%E4%B8%8D%E5%90%8C%E8%A7%92%E5%BA%A6%E5%87%BA%E5%8F%91%E5%8E%BB%E9%9C%80%E6%B1%82%E6%B2%9F%E9%80%9A%E9%97%AE%E9%A2%98/" title="不同角度出发去需求沟通问题">不同角度出发去需求沟通问题</a><time datetime="2024-04-08T07:55:46.000Z" title="发表于 2024-04-08 15:55:46">2024-04-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/smile/2024/04/01/%E4%BA%A7%E5%93%81%E5%95%86%E4%B8%9A%E8%AE%A1%E5%88%92%E6%96%B9%E5%90%91%E6%80%9D%E8%80%83/" title="产品商业计划方向思考"><img src="https://gitee.com/leesmile/image-host/raw/master/images/202310271509358.jpg" onerror="this.onerror=null;this.src='/smile/img/404.jpg'" alt="产品商业计划方向思考"/></a><div class="content"><a class="title" href="/smile/2024/04/01/%E4%BA%A7%E5%93%81%E5%95%86%E4%B8%9A%E8%AE%A1%E5%88%92%E6%96%B9%E5%90%91%E6%80%9D%E8%80%83/" title="产品商业计划方向思考">产品商业计划方向思考</a><time datetime="2024-04-01T07:55:46.000Z" title="发表于 2024-04-01 15:55:46">2024-04-01</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/smile/2024/03/28/%E5%85%AC%E5%8F%B8%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E8%90%BD%E5%9C%B0%E7%9A%84%E9%9A%BE%E7%82%B9/" title="公司自动化测试落地的难点"><img src="https://gitee.com/leesmile/image-host/raw/master/images/202310271509358.jpg" onerror="this.onerror=null;this.src='/smile/img/404.jpg'" alt="公司自动化测试落地的难点"/></a><div class="content"><a class="title" href="/smile/2024/03/28/%E5%85%AC%E5%8F%B8%E8%87%AA%E5%8A%A8%E5%8C%96%E6%B5%8B%E8%AF%95%E8%90%BD%E5%9C%B0%E7%9A%84%E9%9A%BE%E7%82%B9/" title="公司自动化测试落地的难点">公司自动化测试落地的难点</a><time datetime="2024-03-28T07:55:46.000Z" title="发表于 2024-03-28 15:55:46">2024-03-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/smile/2024/03/22/%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E7%9A%84%E5%85%B3%E9%94%AE%E5%9C%A8%E4%BA%A4%E4%BA%92%E8%AE%BE%E8%AE%A1/" title="异步任务的体验关键在交互设计"><img src="https://gitee.com/leesmile/image-host/raw/master/images/202310271509358.jpg" onerror="this.onerror=null;this.src='/smile/img/404.jpg'" alt="异步任务的体验关键在交互设计"/></a><div class="content"><a class="title" href="/smile/2024/03/22/%E5%BC%82%E6%AD%A5%E4%BB%BB%E5%8A%A1%E7%9A%84%E5%85%B3%E9%94%AE%E5%9C%A8%E4%BA%A4%E4%BA%92%E8%AE%BE%E8%AE%A1/" title="异步任务的体验关键在交互设计">异步任务的体验关键在交互设计</a><time datetime="2024-03-22T07:55:46.000Z" title="发表于 2024-03-22 15:55:46">2024-03-22</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/smile/2024/03/11/Git%E5%B7%A5%E4%BD%9C%E6%B5%81/" title="Git工作流"><img src="https://gitee.com/leesmile/image-host/raw/master/images/202310261354386.jpg" onerror="this.onerror=null;this.src='/smile/img/404.jpg'" alt="Git工作流"/></a><div class="content"><a class="title" href="/smile/2024/03/11/Git%E5%B7%A5%E4%BD%9C%E6%B5%81/" title="Git工作流">Git工作流</a><time datetime="2024-03-11T07:55:46.000Z" title="发表于 2024-03-11 15:55:46">2024-03-11</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2024 By Xuan</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i><span id="percent">0<span>%</span></span></button><button id="go-down" type="button" title="直达底部" onclick="btf.scrollToDest(document.body.scrollHeight, 500)"><i class="fas fa-arrow-down"></i></button></div></div><div><script src="/smile/js/utils.js"></script><script src="/smile/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async src="https://cdn1.tianli0.top/npm/vue@2.6.14/dist/vue.min.js"></script><script async src="https://cdn1.tianli0.top/npm/element-ui@2.15.6/lib/index.js"></script><script defer src="/js/cursor.js"></script><script async src="//npm.elemecdn.com/pace-js@1.2.4/pace.min.js"></script><script defer src="https://npm.elemecdn.com/jquery@latest/dist/jquery.min.js"></script><script defer data-pjax src="/js/cat.js"></script><script defer data-pjax src="/js/readPercent.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --> <script data-pjax>if(document.getElementById('recent-posts') && (location.pathname ==='/'|| '/' ==='all')){
    var parent = document.getElementById('recent-posts');
    var child = '<div class="recent-post-item" style="width:100%;height: auto"><div id="catalog_magnet"><a class="magnet_link_more"  href="http://leesmile.gitee.io/smile/categories" style="flex:1;text-align: center;margin-bottom: 10px;">查看更多...</a></div></div>';
    console.log('已挂载magnet')
    parent.insertAdjacentHTML("afterbegin",child)}
     </script><style>#catalog_magnet{flex-wrap: wrap;display: flex;width:100%;justify-content:space-between;padding: 10px 10px 0 10px;align-content: flex-start;}.magnet_item{flex-basis: calc(50% - 5px);background: #87CEFA;margin-bottom: 10px;border-radius: 8px;transition: all 0.2s ease-in-out;}.magnet_item:hover{background: #00FFFF}.magnet_link_more{color:#555}.magnet_link{color:black}.magnet_link:hover{color:white}@media screen and (max-width: 600px) {.magnet_item {flex-basis: 100%;}}.magnet_link_context{display:flex;padding: 10px;font-size:16px;transition: all 0.2s ease-in-out;}.magnet_link_context:hover{padding: 10px 20px;}</style>
    <style></style><script data-pjax>
  function butterfly_footer_beautify_injector_config(){
    var parent_div_git = document.getElementById('footer-wrap');
    var item_html = '<div id="workboard"></div><p id="ghbdages"><a class="github-badge" target="_blank" href="https://hexo.io/" style="margin-inline:5px" data-title="博客框架为Hexo_v6.2.0" title=""><img src="https://img.shields.io/badge/Frame-Hexo-blue?style=flat&amp;logo=hexo" alt=""/></a><a class="github-badge" target="_blank" href="https://butterfly.js.org/" style="margin-inline:5px" data-title="主题版本Butterfly_v4.3.1" title=""><img src="https://img.shields.io/badge/Theme-Butterfly-6513df?style=flat&amp;logo=bitdefender" alt=""/></a><a class="github-badge" target="_blank" href="https://gitee.com/" style="margin-inline:5px" data-title="本站项目由Gitee托管" title=""><img src="https://img.shields.io/badge/Source-Github-d021d6?style=flat&amp;logo=GitHub" alt=""/></a><a class="github-badge" target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/" style="margin-inline:5px" data-title="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可" title=""><img src="https://img.shields.io/badge/Copyright-BY--NC--SA%204.0-d42328?style=flat&amp;logo=Claris" alt=""/></a></p>';
    console.log('已挂载butterfly_footer_beautify')
    parent_div_git.insertAdjacentHTML("beforeend",item_html)
    }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_footer_beautify_injector_config();
  }
  else if (epage === cpage){
    butterfly_footer_beautify_injector_config();
  }
  </script><script async src="https://npm.elemecdn.com/hexo-butterfly-footer-beautify@1.0.0/lib/runtime.js"></script><!-- hexo injector body_end end --></body></html>